home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Human Interface Toolbox / ShadingWinds / ShadingWinds.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  2.6 KB  |  91 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        ShadingWinds.h
  3.  
  4.     Contains:    This little application includes code to allow you to detect whether or not the Shell
  5.                 Window is "rolled up" by WindowShade.  How do you do this?  You check the window's 
  6.                 contRgn.  If the contRgn is empty, then the window is shaded.  You'll note that the
  7.                 grafPort is unchanged by WindowShade, so if you need to save window dimensions, you
  8.                 can grab that information from the portRect.
  9.  
  10.     Written by: Virginia (Ginny) McCulloh     
  11.  
  12.     Copyright:    Copyright © 1995-1999 by Apple Computer, Inc., All Rights Reserved.
  13.  
  14.                 You may incorporate this Apple sample source code into your program(s) without
  15.                 restriction. This Apple sample source code has been provided "AS IS" and the
  16.                 responsibility for its operation is yours. You are not permitted to redistribute
  17.                 this Apple sample source code as "Apple sample source code" after having made
  18.                 changes. If you're going to re-distribute the source, we require that you make
  19.                 it clear in the source that the code was descended from Apple sample source
  20.                 code, but that you've made changes.
  21.  
  22.     Change History (most recent first):
  23.                 8/9/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  24.                 
  25.  
  26. */
  27.  
  28. /*****    #includes    *****/
  29. #include    <QuickDraw.h>
  30. #include    <Fonts.h>
  31. #include    <Menus.h>
  32. #include     <Events.h>
  33. #include    <Gestalt.h>
  34. #include    <Windows.h>
  35. #include    <Dialogs.h>
  36. #include    <Desk.h>
  37. #include     <Resources.h>
  38. #include    <SegLoad.h>
  39. #include    <ToolUtils.h>
  40. #include    <Types.h>
  41. #include    <AppleEvents.h>
  42.  
  43.  
  44. /*****    #defines    *****/
  45. #define     NIL                    0L            /*  could also be written  "0x00000000"        */
  46. #define        UNIMPLEMENTED         0xA89F        /* A-trap code for unimplemented function     */
  47. #define        WAITNEXTEVENT        0xA860        /* A-trap code for WaitNextEvent()             */
  48.  
  49. /*    kExtremeNeg and kExtremePos are used to set up wide open rectangles and regions. */
  50. #define kExtremeNeg                -32700
  51. #define kExtremePos                32700
  52.  
  53.  
  54. #define        WINDOWID            2000
  55. #define        PUTINFRONT            (WindowPtr) -1L
  56.  
  57. #define        ABOUTID                5000
  58.  
  59. #define        APPLEMENU            5001
  60. #define            appleABOUT        1
  61. #define        FILEMENU            5002
  62. #define            fileQUIT        1
  63. #define        EDITMENU            5003
  64. #define            editUNDO        1
  65.             /* ---------- */
  66. #define            editCUT            3
  67. #define            editCOPY        4
  68. #define            editPASTE        5
  69. #define            editCLEAR        6
  70. #define            editSELECTALL    7
  71.  
  72. #define        TESTMENU            5004
  73. #define            testWINDSHADE    1
  74. #define            testHIDEWIND    2
  75. #define            testREVEALWIND    3
  76.  
  77.  
  78. #define        MAXMENUS            4
  79. #define        FIRSTMENUID            5001
  80.  
  81. #define        TESTALERTID            6000
  82. #define        BADSYSTEMID            6001
  83. #define        BADQUICKDRAWID        6002
  84. #define        NOAPPLEEVENTS        6003
  85.  
  86.  
  87. // Handy macros
  88. #define TopLeft(aRect)    (* (Point *) &(aRect).top)
  89. #define BotRight(aRect)    (* (Point *) &(aRect).bottom)
  90.  
  91.